Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow compressing arrays larger than 4 GB #105

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nhz2
Copy link

@nhz2 nhz2 commented May 16, 2023

Work toward fixing #95

Before this PR Zlib.Writer and Zlib.crc32 could not handle more than 4 GB at a time because of a limitation of the zlib C library.

This PR runs the compressor on chunks of the input data in a loop to avoid the issue.

To test this requires at least 8 GB of memory, so I put the tests in a separate file, "bigtests.jl".

To run these tests run:

julia> import Pkg

julia> Pkg.test("ZipFile"; test_args=["bigtests"])

Or just run "bigtests.jl" as a julia script in a project with ZipFile.

@nhz2 nhz2 marked this pull request as draft May 16, 2023 01:39
@nhz2 nhz2 marked this pull request as ready for review May 16, 2023 02:10
@nhz2
Copy link
Author

nhz2 commented May 16, 2023

@ThummeTo @ssingh13-rms @fhs This is ready for review.
For reference,
The zlib C documentation is here: https://github.com/madler/zlib/blob/master/zlib.h
And https://github.com/madler/zipflow/blob/2bef2123ebe519c17b18d2d0c3c71065088de952/zipflow.c#L774C1-L827 contains an example of using zlib to write zip64 files in C.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant